package com.lxyk.service;

import com.lxyk.pojo.Dept;
import com.lxyk.pojo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@Component //注册到spring容器中
@FeignClient(value = "spring-cloud-alibaba-provider-mysql") //远程调用
public interface DeptFeignService {

    @GetMapping(value = "/dept/get/{id}")
    public Result<Dept> getByID(@PathVariable("id") Integer id);

    @GetMapping(value = "/dept/list")
    public Result<List<Dept>> list();
}
